import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'layout',
    component: () => import(/* webpackChunkName: "layout" */ '@/views/layout'),
    children: [{
      path: '/',
      name: 'home',
      component: () => import(/* webpackChunkName: "home" */'@/views/home')
    },{
      path: '/classify',
      name: 'classify',
      component: () => import(/* webpackChunkName: "classify" */'@/views/classify')
    },{
      path: '/car',
      name: 'car',
      component: () => import(/* webpackChunkName: "car" */'@/views/car')
    },{
      path: '/my',
      name: 'my',
      component: () => import(/* webpackChunkName: "my" */'@/views/my')
    }]
  },
  {
    path: '/posts/:id',
    name: 'detail',
    component: () => import(/* webpackChunkName: "detail" */ '@/views/details')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
